/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.urbainski.estagio.entidade;

import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 *
 * @author Cristian Elder Urbainski
 * @since 11/12/2011
 */
@Entity
@Table(name = "materia")
public class Materia implements Serializable {
   
    private static final long serialVersionUID = 1L;
    
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id_materia")
    private Integer idMateria;
    
    @Column(name = "id_professor")
    private Integer idProfessor;
    
    @Column(name = "ds_materia")
    private String dsMateria;
    
    @Column(name = "tp_situacao")
    private int tpSituacao;
    
    @ManyToOne(optional = false, fetch = FetchType.LAZY)
    @JoinColumn(name = "id_professor", referencedColumnName = "id_professor", insertable = false, updatable= false)
    private Professor professor;

    public String getDsMateria() {
        return dsMateria;
    }

    public void setDsMateria(String dsMateria) {
        this.dsMateria = dsMateria;
    }

    public Integer getIdMateria() {
        return idMateria;
    }

    public void setIdMateria(Integer idMateria) {
        this.idMateria = idMateria;
    }

    public Integer getIdProfessor() {
        return idProfessor;
    }

    public void setIdProfessor(Integer idProfessor) {
        this.idProfessor = idProfessor;
    }

    public Professor getProfessor() {
        return professor;
    }

    public void setProfessor(Professor professor) {
        this.professor = professor;
    }

    public int getTpSituacao() {
        return tpSituacao;
    }

    public void setTpSituacao(int tpSituacao) {
        this.tpSituacao = tpSituacao;
    }
}
